package com.example.timessquare;

import com.squareup.timessquare.CalendarCellView;
import com.squareup.timessquare.DayViewAdapter;
import ohos.agp.components.Component;
import ohos.agp.components.LayoutScatter;
import ohos.agp.components.Text;

/**
 * SampleDayViewAdapter
 */
public class SampleDayViewAdapter implements DayViewAdapter {

    @Override
    public void makeCellView(CalendarCellView parent) {
        LayoutScatter inflater = LayoutScatter.getInstance(parent.getContext());
        Component layout = inflater.parse(ResourceTable.Layout_day_view_custom, parent, false);
        parent.addComponent(layout);
        parent.setDayOfMonthTextView((Text) layout.findComponentById(ResourceTable.Id_day_view));
    }
}